var year = parseInt(prompt("输入一个年份"));
if (year % 100 == 0)
{
    if (year % 400 == 0)
        alert("闰年");
    else
        alert("非闰年");
}
else 
{
    if (year % 4 == 0)
        alert("闰年");
    else
        alert("非闰年");
}